All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH v2 2/2] drm/i915/icl: reverse uninit order
Date: Tue, 13 Nov 2018 15:19:06 +0200	[thread overview]
Message-ID: <20181113131906.GA15029@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20181113024503.28886-2-lucas.demarchi@intel.com>

On Mon, Nov 12, 2018 at 06:45:03PM -0800, Lucas De Marchi wrote:
> Bspec 21257 says "DDIA PHY is the comp master, so it must
> not be un-initialized if other combo PHYs are in use". Here
> we are shutting down all phys, so it's not strictly required.
> However let's be consistent on deinitializing things in the
> reversed order we initialized them.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_combo_phy.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_combo_phy.c b/drivers/gpu/drm/i915/intel_combo_phy.c
> index 49f3a533860d..9c06be45b84e 100644
> --- a/drivers/gpu/drm/i915/intel_combo_phy.c
> +++ b/drivers/gpu/drm/i915/intel_combo_phy.c
> @@ -9,6 +9,12 @@
>  	for ((__port) = PORT_A; (__port) < I915_MAX_PORTS; (__port)++)	\
>  		for_each_if(intel_port_is_combophy(__dev_priv, __port))
>  
> +#define for_each_combo_port_rev(__dev_priv, __port) \
> +	for ((__port) = I915_MAX_PORTS - 1; \
> +	     (__port) >= PORT_A && (__port) < I915_MAX_PORTS; \
> +	     (__port)--) \

Heh, so 'enum port' is unsigned. Surely I would have get this right
only after seeing it fail with only the >= condition :) An
alternative:

	for ((__port) = I915_MAX_PORTS; (__port)-- > 0;)

or add a negative value, like INVALID_PORT=-1 to 'enum port', but we'd
need some user for that too. Either way:

Reviewed-by: Imre Deak <imre.deak@intel.com>

> +		for_each_if(intel_port_is_combophy(__dev_priv, __port))
> +
>  enum {
>  	PROCMON_0_85V_DOT_0,
>  	PROCMON_0_95V_DOT_0,
> @@ -232,7 +238,7 @@ void icl_combo_phys_uninit(struct drm_i915_private *dev_priv)
>  {
>  	enum port port;
>  
> -	for_each_combo_port(dev_priv, port) {
> +	for_each_combo_port_rev(dev_priv, port) {
>  		u32 val;
>  
>  		if (!icl_combo_phy_verify_state(dev_priv, port))
> -- 
> 2.19.1.1.g56c4683e68
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-11-13 13:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13  2:45 [PATCH v2 1/2] drm/i915/icl: replace check for combo phy Lucas De Marchi
2018-11-13  2:45 ` [PATCH v2 2/2] drm/i915/icl: reverse uninit order Lucas De Marchi
2018-11-13 13:19   ` Imre Deak [this message]
2018-11-13 13:23     ` Imre Deak
2018-11-13 17:40       ` Lucas De Marchi
2018-11-13 18:56       ` [PATCH v2] " Lucas De Marchi
2018-11-13 20:31         ` Jani Nikula
2018-11-13 21:22           ` Lucas De Marchi
2018-11-13 21:57             ` Jani Nikula
2018-11-13  3:09 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/2] drm/i915/icl: replace check for combo phy Patchwork
2018-11-13  3:35 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-13  5:05 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-13 13:44 ` [PATCH v2 1/2] " Imre Deak
2018-11-13 19:08 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/2] drm/i915/icl: replace check for combo phy (rev2) Patchwork
2018-11-13 19:30 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-14 17:23 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181113131906.GA15029@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=paulo.r.zanoni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.