From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1513EC43381 for ; Thu, 7 Mar 2019 10:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E18D920675 for ; Thu, 7 Mar 2019 10:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbfCGKWn (ORCPT ); Thu, 7 Mar 2019 05:22:43 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:45983 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbfCGKWn (ORCPT ); Thu, 7 Mar 2019 05:22:43 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x27ALDiH008888; Thu, 7 Mar 2019 11:22:29 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r315ur4b2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 07 Mar 2019 11:22:29 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 626CE31; Thu, 7 Mar 2019 10:22:26 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node2.st.com [10.75.127.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 605782867; Thu, 7 Mar 2019 10:22:26 +0000 (GMT) Received: from [10.48.0.160] (10.75.127.49) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 7 Mar 2019 11:22:25 +0100 Subject: Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm 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" References: <1551885142-22365-1-git-send-email-bich.hemon@st.com> From: Pierre Yves MORDRET Message-ID: <04076973-8512-e4bc-21d9-28f04006c7f6@st.com> Date: Thu, 7 Mar 2019 11:22:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1551885142-22365-1-git-send-email-bich.hemon@st.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG4NODE1.st.com (10.75.127.10) To SFHDAG5NODE2.st.com (10.75.127.14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-07_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; > } > } > >