From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Yves MORDRET Subject: Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm Date: Thu, 7 Mar 2019 11:22:25 +0100 Message-ID: <04076973-8512-e4bc-21d9-28f04006c7f6@st.com> References: <1551885142-22365-1-git-send-email-bich.hemon@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1551885142-22365-1-git-send-email-bich.hemon@st.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Bich HEMON , Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre TORGUE , Wolfram Sang , "linux-i2c@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" List-Id: linux-i2c@vger.kernel.org Hi Reviewed-by: Pierre-Yves MORDRET Thanks On 3/6/19 4:12 PM, Bich HEMON wrote: > From: Nicolas Le Bayon > > This avoids useless loops inside the I2C timing algorithm. > Actually, we support only one possible solution per prescaler value. > So after finding a solution with a prescaler, the algorithm can > switch directly to the next prescaler value. > > Signed-off-by: Nicolas Le Bayon > Signed-off-by: Bich Hemon > --- > drivers/i2c/busses/i2c-stm32f7.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c > index 4284fc9..48337be 100644 > --- a/drivers/i2c/busses/i2c-stm32f7.c > +++ b/drivers/i2c/busses/i2c-stm32f7.c > @@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev, > > list_add_tail(&v->node, > &solutions); > + break; > } > } > + > + if (p_prev == p) > + break; > } > } > >