Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4867045imb; Thu, 7 Mar 2019 02:23:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzKN7tWfDEMizHvAVfmCvV+vQt0rBRlZjUVqVII5f8d7aU37y/dl8p2oNs8oXJeYz1U1l+q X-Received: by 2002:a17:902:744b:: with SMTP id e11mr12000135plt.220.1551954224922; Thu, 07 Mar 2019 02:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551954224; cv=none; d=google.com; s=arc-20160816; b=SiXpgBsOLXe5cctFHYvxyUDEUjP3mITG3JWga+xzQ7ZemYKi2CySkS1OPOQZxcgaXC 7PwA8Y4ydoBPaGNmKf3/q2r1p2ys5emCX2ie7QfHDzbDMhXQnz2BUEocBLU/T8gOx3dt hr1HD8nt74tgG7s5NFdGRNoe0ZzJAAp64CEfQ6jNM5t0ZERS8CqdC2HiGRjCPDNDrp1f ZNTga41ZVrlH1n0OvnU7yHbrG3/4iZmGbF4Qo5dXoE938d5auk+uZEof26ZTD2Kx0mE7 SdbOgulkBn4FT0hfxjepssPu7iz36lXtNUT8uKCQUWJ7Tf3fJN6YNzG2+s5oymuTm124 Z9vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=PtuTPWJdba80PnYFB/Dmfy6/ymDEVSezG5G68pBuDeA=; b=FYgQ9p+M8d0IimAgTyMO7h5My92zby9KDDV7ZeycoFrHw67wxjCylthPEcUs0jStYc QB39SCuLR01CsJcJIKo0spOWhIi8WyfmMoh0UEWGFhkNs2IDdwal87AGE+4UThW8eQy8 AWGo8IJHd7XP/5ceEyVbBgimbk8QWlYB+hSeL19ugFpBWgkjbtjyVdrsmAfwhFMeQOYc +5OpxMVKggmJPZeOqi0cenGtXwT6t9torA5JR25U8wZpuxiFLoscxH5f2D3NhllFv7Ws Pdg6NQ/N/UTM5L44MUzhaTO0+E2cKhMQ56ZWQ4f0sunlNzRW9NAa0f1gimYgN5hhLkpG Fk+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si3784047pll.286.2019.03.07.02.23.29; Thu, 07 Mar 2019 02:23:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726375AbfCGKWn (ORCPT + 99 others); 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; > } > } > >