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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 86F57C43381 for ; Wed, 6 Mar 2019 15:26:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51E6520675 for ; Wed, 6 Mar 2019 15:26:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nOH0l9J6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eU06hR7C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51E6520675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MeOKtXJQkBUC0j3BCamjnFUosrmCOvIFZcOyo1UnUnQ=; b=nOH0l9J6bbdGpr jUJ8C/D5XMxqs/B5dCmc53eZwJDGHY7warDF9VISiFhS8C9WUSBoGTOunujtj4PbpyQq90NHWgne9 1jqNporNHxhMWTaksXNy8wf+FsaU6eXXT+Gn1pqNaYEG8jDfAwxtl6+/xtvdZhWCs6+EvKZqottef +WCK6TJ2luCrP1rlNzn90TENW6JxDbSCgntKHZj121AlUcQh8XjNoCzLN/WT8Qvu7Ih3WSSPeeZdV KOmCY6e1ufDmpWf8n2Z5AXKjwEGJJVP5ur75rG6zz6hVrCM8sUJYUBbG7suQEWig43ZUPt0cH1D5S A5kXhOKMPKCw6N7WAQOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1YRM-00041z-Si; Wed, 06 Mar 2019 15:26:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1YDs-0006Np-Ov for linux-arm-kernel@bombadil.infradead.org; Wed, 06 Mar 2019 15:12:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SNtyCIO8fKz5UmHiPNvxCaZlcnvo5UElvUJ0r9mxsvg=; b=eU06hR7CI1wT1VEgZiGffWaDMZ HSjJEKQTVWlcLIHTJ2TpGi3INiXj2RyNYI/0q9fPATlDB+Y6kJ1stmP2m7iJNxbTD3Sk1CtNJGfA6 74ouEC15JBvL1kvAuak5Sw0ImvRLgANzGT4ws682FRCeFB2vWIgu0VCQYaD2MyQZ/M0C1xeDcHaH5 k5/F8J59C3WRfjUcYIq58w9QHO649gcpl7AJ9K5cJibJOJUT99hpivYeZgLZxBkvcudkhIaVbEMKb KTonSnIjkcKWqgSn2JnXfSyT/nK3ywM7lR3VNJLVykuCqVDaCQd5GmmO0LzkHT4zyoNlzS0+PGHvN RzdRpfgw==; Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1YDo-0006Z3-G8 for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2019 15:12:43 +0000 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 x26F8arO023739; Wed, 6 Mar 2019 16:12:34 +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 2qygfxrqxg-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 06 Mar 2019 16:12:34 +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 B689234; Wed, 6 Mar 2019 15:12:33 +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 8EC674E55; Wed, 6 Mar 2019 15:12:33 +0000 (GMT) Received: from SFHDAG3NODE1.st.com (10.75.127.7) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 6 Mar 2019 16:12:33 +0100 Received: from SFHDAG3NODE1.st.com ([fe80::1166:1abb:aad4:5f86]) by SFHDAG3NODE1.st.com ([fe80::1166:1abb:aad4:5f86%20]) with mapi id 15.00.1347.000; Wed, 6 Mar 2019 16:12:33 +0100 From: Bich HEMON To: Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre TORGUE , Pierre Yves MORDRET , 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" Subject: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm Thread-Topic: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm Thread-Index: AQHU1C8FuKVQOuQSP06mzKYbD5HeAQ== Date: Wed, 6 Mar 2019 15:12:32 +0000 Message-ID: <1551885142-22365-1-git-send-email-bich.hemon@st.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.51] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-06_10:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190306_151240_623489_CEDF1BA3 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bich HEMON Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; } } -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel