Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1319505rwb; Wed, 14 Dec 2022 08:50:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Is1uJME82g+RjrFyzb3ucY9xYighUeT7z0V2pEM0b8eCAMevzkw96Gu3JuxU+KN43TT8/ X-Received: by 2002:a17:906:ae56:b0:7c0:b569:8efe with SMTP id lf22-20020a170906ae5600b007c0b5698efemr19724328ejb.60.1671036632367; Wed, 14 Dec 2022 08:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671036632; cv=none; d=google.com; s=arc-20160816; b=GSUrsFjAWUzK+E09Z0RWrrdKt6ANhg8uygl19ZzLfaSKDujUjx30Rn9ejKxlWtwcxJ hj4goa4/CmWArAnIKsUKUauP+m9yVwF2trtkSp21pvn5owL5x24Bw1tmVA7G0gP48S6m O8RXA1LAjXn1jTvjAUGKgS16m+7cEuZg6m6S8UZJc/xmGeEFtsehcfYw6Tnq3MWEZsPb NML4N48K58MsjvZySfD5JH9VXgBJQoOwP6HSQAQMde6LjnQZQLJFrJGqZDHKF4NNPm5w OjJNSf6IDRiBzO/L99sgvMPAi6Z1QjMB1+xh742Kl6bv3lvsVzUeZ+ztSYJ2Hae606+N 3voQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GRFUHCAKk4euu2kdRkckFqX92AzuDbuI1zhIFzTI3+U=; b=OEAgxhFh1GAwJ03tAqnKhJVdvCNbSlj1nU5VojW8XVrYFkU5vnGnOueBaLiJRSpUyA dtCh3+OsypJ8qBBIGwXzXv74wmUEYlWwrnYPA2e2Yx9mPH/tkF3y2eqUfICJXHYl4YOT OLpKaNJDDLCxOFhGoOFBkec8AM91mZhavVefAX0U9RdbAo7/itRnRm3POSDl3l4DkyQB nIOvRtuzt7TLo1Qke4qVccOkkv9cUSJC+5OG/AJJKw+gkYIitheou1FZXeurGRyxxuAW I0q7Vekk2jhxkuMqk1lplHrY9c6KNE021FtpGZGcRpdappr9zjD755l1xHpwFfw09XI5 mNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CXcLFm6G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd30-20020a170907969e00b007addbdb9fbbsi12258425ejc.558.2022.12.14.08.50.15; Wed, 14 Dec 2022 08:50:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CXcLFm6G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbiLNQTn (ORCPT + 69 others); Wed, 14 Dec 2022 11:19:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238665AbiLNQTY (ORCPT ); Wed, 14 Dec 2022 11:19:24 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D504275C7; Wed, 14 Dec 2022 08:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671034763; x=1702570763; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=bHQmTIESlqQ4cB0aHihs1PbSoibkX1YdNqvQO1bLf2c=; b=CXcLFm6GGOAGvvp73IRYY8hWARxJ1wZGga1CHIufJOIkNnisbMIW6qHj oYowpkzVHzrQU3K/plhLtaaX3Jety295XNhv0IR6/Tw00A/crxAmO0Cp4 BuJyxuKNUhnSQWJb/hyU8/2dovKq0nu8mK5m5LTW/xp6T/sgD8NFpzaWt pz3V43FeYzYztvxK7tx6fPi/Jlv8mC01TE1XcEP9EEYOu1E0eUCzP9naE X60M3vPD3CJlFDwfXGFWqdOCQsQhGxQLAwaPq7XxnPo9r4IXKun50V5Ne KV9QeYpccFuGVyaglCVBJUQ5yHTejopm3p0eT+4vqc39/YGSA6sD+aFO7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="404715664" X-IronPort-AV: E=Sophos;i="5.96,244,1665471600"; d="scan'208";a="404715664" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 08:19:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="755953555" X-IronPort-AV: E=Sophos;i="5.96,244,1665471600"; d="scan'208";a="755953555" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 14 Dec 2022 08:19:19 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p5UTV-009taJ-0L; Wed, 14 Dec 2022 18:19:17 +0200 Date: Wed, 14 Dec 2022 18:19:16 +0200 From: Andy Shevchenko To: Hanna Hawa Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, benh@amazon.com, ronenk@amazon.com, talel@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, farbere@amazon.com, itamark@amazon.com, lareine@amazon.com Subject: Re: [PATCH v2 1/1] i2c: designware: use u64 for clock freq to avoid u32 multiplication overflow Message-ID: References: <20221214154117.65714-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 14, 2022 at 06:18:07PM +0200, Andy Shevchenko wrote: > On Wed, Dec 14, 2022 at 06:12:12PM +0200, Andy Shevchenko wrote: > > On Wed, Dec 14, 2022 at 03:41:17PM +0000, Hanna Hawa wrote: > > > From: Lareine Khawaly > > > > > > In functions i2c_dw_scl_lcnt() and i2c_dw_scl_hcnt() may have overflow > > > by depending on the values of the given parameters including the ic_clk. > > > For example in our use case where ic_clk is larger than one million, > > > multiplication of ic_clk * 4700 will result in 32 bit overflow. > > > > > > Make the ic_clk to be u64 parameter to avoid the overflow. > > > > Below my comment, after addressing it, > > Reviewed-by: Andy Shevchenko > > Sorry, was too quick. I have to withdraw my tag since this patch obviously > breaks a compilation for Intel Quark chip. ld: drivers/i2c/busses/i2c-designware-common.o: in function `i2c_dw_scl_hcnt': i2c-designware-common.c:(.text+0x5fe): undefined reference to `__udivdi3' ld: i2c-designware-common.c:(.text+0x634): undefined reference to `__udivdi3' ld: drivers/i2c/busses/i2c-designware-common.o: in function `i2c_dw_scl_lcnt': i2c-designware-common.c:(.text+0x679): undefined reference to `__udivdi3' > Please, test it carefully and submit new version when it will be ready. -- With Best Regards, Andy Shevchenko