mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Adam Ford <aford173@gmail.com>, linux-phy@lists.infradead.org
Cc: aford@beaconembedded.com, sandor.yu@nxp.com,
	"Vinod Koul" <vkoul@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Dominique Martinet" <dominique.martinet@atmark-techno.com>,
	"Marco Felsch" <m.felsch@pengutronix.de>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found
Date: Tue, 22 Oct 2024 09:06:13 +0200	[thread overview]
Message-ID: <369722cf-834c-4a8f-a64b-622c75fa2537@kontron.de> (raw)
In-Reply-To: <20241020165102.340838-2-aford173@gmail.com>

On 20.10.24 6:50 PM, Adam Ford wrote:
> There are a series of for-loops which check various values of P and S
> for the integer divder PLL.  The for loops search all entries and use
> the one closest to the nominal, but it continues to searches through
> all for loops even after the nominal is achieved.  Ending when the
> nominal value is found stops wasting time, since it will not find
> a better value than a deviation of 0 Hz.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

> ---
>  drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> index 3f9578f3f0ac..719f8972cb5a 100644
> --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> @@ -440,9 +440,13 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
>  				min_delta = delta;
>  				best_freq = tmp;
>  			}
> +
> +			/* If we have an exact match, stop looking for a better value */
> +			if (!delta)
> +				goto done;
>  		}
>  	}
> -
> +done:
>  	if (best_freq) {
>  		*p = best_p;
>  		*m = best_m;


  reply	other threads:[~2024-10-22  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20 16:50 [PATCH 1/3] phy: freescale: fsl-samsung-hdmi: Expand Integer divider range Adam Ford
2024-10-20 16:50 ` [PATCH 2/3] phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found Adam Ford
2024-10-22  7:06   ` Frieder Schrempf [this message]
2024-10-20 16:50 ` [PATCH 3/3] phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation Adam Ford
2024-10-22  7:16   ` Frieder Schrempf
2024-10-22  7:04 ` [PATCH 1/3] phy: freescale: fsl-samsung-hdmi: Expand Integer divider range Frieder Schrempf
2024-10-23 15:04   ` Adam Ford

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=369722cf-834c-4a8f-a64b-622c75fa2537@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=aford173@gmail.com \
    --cc=aford@beaconembedded.com \
    --cc=dominique.martinet@atmark-techno.com \
    --cc=kishon@kernel.org \
    --cc=l.stach@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    --cc=sandor.yu@nxp.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®