diff mbox series

[3/6] drm/i915/pm: Simplify pm hook documentation

Message ID 20240925144526.2482-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/pm: Clean up the hibernate vs. PCI D3 quirk | expand

Commit Message

Ville Syrjälä Sept. 25, 2024, 2:45 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Stop spelling out each variant of the hook ("" vs. "_late" vs.
"_early") and just say eg. "@thaw*" to indicate all of them.
Avoids having to update the docs whenever we start/stop using
one of the variants.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: linux-pci@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_driver.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Rodrigo Vivi Sept. 26, 2024, 2:45 p.m. UTC | #1
On Wed, Sep 25, 2024 at 05:45:23PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Stop spelling out each variant of the hook ("" vs. "_late" vs.
> "_early") and just say eg. "@thaw*" to indicate all of them.
> Avoids having to update the docs whenever we start/stop using
> one of the variants.

That or simply remove them all and refer only to the pm documentation?
"Entering Hibernation" of Documentation/driver-api/pm/devices.rst

> 
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: linux-pci@vger.kernel.org
> Cc: intel-gfx@lists.freedesktop.org
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 9d557ff8adf5..1e5abf72dfc4 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1644,18 +1644,18 @@ const struct dev_pm_ops i915_pm_ops = {
>  
>  	/*
>  	 * S4 event handlers
> -	 * @freeze, @freeze_late    : called (1) before creating the
> -	 *                            hibernation image [PMSG_FREEZE] and
> -	 *                            (2) after rebooting, before restoring
> -	 *                            the image [PMSG_QUIESCE]
> -	 * @thaw, @thaw_early       : called (1) after creating the hibernation
> -	 *                            image, before writing it [PMSG_THAW]
> -	 *                            and (2) after failing to create or
> -	 *                            restore the image [PMSG_RECOVER]
> -	 * @poweroff, @poweroff_late: called after writing the hibernation
> -	 *                            image, before rebooting [PMSG_HIBERNATE]
> -	 * @restore, @restore_early : called after rebooting and restoring the
> -	 *                            hibernation image [PMSG_RESTORE]
> +	 * @freeze*   : called (1) before creating the
> +	 *              hibernation image [PMSG_FREEZE] and
> +	 *              (2) after rebooting, before restoring
> +	 *              the image [PMSG_QUIESCE]
> +	 * @thaw*     : called (1) after creating the hibernation
> +	 *              image, before writing it [PMSG_THAW]
> +	 *              and (2) after failing to create or
> +	 *              restore the image [PMSG_RECOVER]
> +	 * @poweroff* : called after writing the hibernation
> +	 *              image, before rebooting [PMSG_HIBERNATE]
> +	 * @restore*  : called after rebooting and restoring the
> +	 *              hibernation image [PMSG_RESTORE]
>  	 */
>  	.freeze = i915_pm_freeze,
>  	.freeze_late = i915_pm_freeze_late,
> -- 
> 2.44.2
>
Ville Syrjälä Sept. 26, 2024, 3:38 p.m. UTC | #2
On Thu, Sep 26, 2024 at 10:45:44AM -0400, Rodrigo Vivi wrote:
> On Wed, Sep 25, 2024 at 05:45:23PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Stop spelling out each variant of the hook ("" vs. "_late" vs.
> > "_early") and just say eg. "@thaw*" to indicate all of them.
> > Avoids having to update the docs whenever we start/stop using
> > one of the variants.
> 
> That or simply remove them all and refer only to the pm documentation?
> "Entering Hibernation" of Documentation/driver-api/pm/devices.rst

That's not very succinct. Having a better quick overview
of the whole situation might still be nice. 

> 
> > 
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_driver.c | 24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> > index 9d557ff8adf5..1e5abf72dfc4 100644
> > --- a/drivers/gpu/drm/i915/i915_driver.c
> > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > @@ -1644,18 +1644,18 @@ const struct dev_pm_ops i915_pm_ops = {
> >  
> >  	/*
> >  	 * S4 event handlers
> > -	 * @freeze, @freeze_late    : called (1) before creating the
> > -	 *                            hibernation image [PMSG_FREEZE] and
> > -	 *                            (2) after rebooting, before restoring
> > -	 *                            the image [PMSG_QUIESCE]
> > -	 * @thaw, @thaw_early       : called (1) after creating the hibernation
> > -	 *                            image, before writing it [PMSG_THAW]
> > -	 *                            and (2) after failing to create or
> > -	 *                            restore the image [PMSG_RECOVER]
> > -	 * @poweroff, @poweroff_late: called after writing the hibernation
> > -	 *                            image, before rebooting [PMSG_HIBERNATE]
> > -	 * @restore, @restore_early : called after rebooting and restoring the
> > -	 *                            hibernation image [PMSG_RESTORE]
> > +	 * @freeze*   : called (1) before creating the
> > +	 *              hibernation image [PMSG_FREEZE] and
> > +	 *              (2) after rebooting, before restoring
> > +	 *              the image [PMSG_QUIESCE]
> > +	 * @thaw*     : called (1) after creating the hibernation
> > +	 *              image, before writing it [PMSG_THAW]
> > +	 *              and (2) after failing to create or
> > +	 *              restore the image [PMSG_RECOVER]
> > +	 * @poweroff* : called after writing the hibernation
> > +	 *              image, before rebooting [PMSG_HIBERNATE]
> > +	 * @restore*  : called after rebooting and restoring the
> > +	 *              hibernation image [PMSG_RESTORE]
> >  	 */
> >  	.freeze = i915_pm_freeze,
> >  	.freeze_late = i915_pm_freeze_late,
> > -- 
> > 2.44.2
> >
Rodrigo Vivi Sept. 26, 2024, 4:10 p.m. UTC | #3
On Thu, Sep 26, 2024 at 06:38:56PM +0300, Ville Syrjälä wrote:
> On Thu, Sep 26, 2024 at 10:45:44AM -0400, Rodrigo Vivi wrote:
> > On Wed, Sep 25, 2024 at 05:45:23PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Stop spelling out each variant of the hook ("" vs. "_late" vs.
> > > "_early") and just say eg. "@thaw*" to indicate all of them.
> > > Avoids having to update the docs whenever we start/stop using
> > > one of the variants.
> > 
> > That or simply remove them all and refer only to the pm documentation?
> > "Entering Hibernation" of Documentation/driver-api/pm/devices.rst
> 
> That's not very succinct. Having a better quick overview
> of the whole situation might still be nice. 

Fair enough.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> 
> > 
> > > 
> > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Cc: linux-pci@vger.kernel.org
> > > Cc: intel-gfx@lists.freedesktop.org
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_driver.c | 24 ++++++++++++------------
> > >  1 file changed, 12 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> > > index 9d557ff8adf5..1e5abf72dfc4 100644
> > > --- a/drivers/gpu/drm/i915/i915_driver.c
> > > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > > @@ -1644,18 +1644,18 @@ const struct dev_pm_ops i915_pm_ops = {
> > >  
> > >  	/*
> > >  	 * S4 event handlers
> > > -	 * @freeze, @freeze_late    : called (1) before creating the
> > > -	 *                            hibernation image [PMSG_FREEZE] and
> > > -	 *                            (2) after rebooting, before restoring
> > > -	 *                            the image [PMSG_QUIESCE]
> > > -	 * @thaw, @thaw_early       : called (1) after creating the hibernation
> > > -	 *                            image, before writing it [PMSG_THAW]
> > > -	 *                            and (2) after failing to create or
> > > -	 *                            restore the image [PMSG_RECOVER]
> > > -	 * @poweroff, @poweroff_late: called after writing the hibernation
> > > -	 *                            image, before rebooting [PMSG_HIBERNATE]
> > > -	 * @restore, @restore_early : called after rebooting and restoring the
> > > -	 *                            hibernation image [PMSG_RESTORE]
> > > +	 * @freeze*   : called (1) before creating the
> > > +	 *              hibernation image [PMSG_FREEZE] and
> > > +	 *              (2) after rebooting, before restoring
> > > +	 *              the image [PMSG_QUIESCE]
> > > +	 * @thaw*     : called (1) after creating the hibernation
> > > +	 *              image, before writing it [PMSG_THAW]
> > > +	 *              and (2) after failing to create or
> > > +	 *              restore the image [PMSG_RECOVER]
> > > +	 * @poweroff* : called after writing the hibernation
> > > +	 *              image, before rebooting [PMSG_HIBERNATE]
> > > +	 * @restore*  : called after rebooting and restoring the
> > > +	 *              hibernation image [PMSG_RESTORE]
> > >  	 */
> > >  	.freeze = i915_pm_freeze,
> > >  	.freeze_late = i915_pm_freeze_late,
> > > -- 
> > > 2.44.2
> > > 
> 
> -- 
> Ville Syrjälä
> Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 9d557ff8adf5..1e5abf72dfc4 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1644,18 +1644,18 @@  const struct dev_pm_ops i915_pm_ops = {
 
 	/*
 	 * S4 event handlers
-	 * @freeze, @freeze_late    : called (1) before creating the
-	 *                            hibernation image [PMSG_FREEZE] and
-	 *                            (2) after rebooting, before restoring
-	 *                            the image [PMSG_QUIESCE]
-	 * @thaw, @thaw_early       : called (1) after creating the hibernation
-	 *                            image, before writing it [PMSG_THAW]
-	 *                            and (2) after failing to create or
-	 *                            restore the image [PMSG_RECOVER]
-	 * @poweroff, @poweroff_late: called after writing the hibernation
-	 *                            image, before rebooting [PMSG_HIBERNATE]
-	 * @restore, @restore_early : called after rebooting and restoring the
-	 *                            hibernation image [PMSG_RESTORE]
+	 * @freeze*   : called (1) before creating the
+	 *              hibernation image [PMSG_FREEZE] and
+	 *              (2) after rebooting, before restoring
+	 *              the image [PMSG_QUIESCE]
+	 * @thaw*     : called (1) after creating the hibernation
+	 *              image, before writing it [PMSG_THAW]
+	 *              and (2) after failing to create or
+	 *              restore the image [PMSG_RECOVER]
+	 * @poweroff* : called after writing the hibernation
+	 *              image, before rebooting [PMSG_HIBERNATE]
+	 * @restore*  : called after rebooting and restoring the
+	 *              hibernation image [PMSG_RESTORE]
 	 */
 	.freeze = i915_pm_freeze,
 	.freeze_late = i915_pm_freeze_late,